/**
 * Interface for binary nodes used in a BST
 * @author Gilberto Gaxiola
 */

public interface BinaryNode<K extends Comparable<K>> {

	/**
	 * Returns the data held by this node.  Returns NULL for empty nodes.
	 * @return data held here or null
	 */
	public K getData();
	
	/**
	 * Sets the data held by this node.
	 * @param newValue the new value of this node
	 */
	public void setData(K newValue);
	
	/**
	 * Is this an "empty" node?
	 * @return true if yes, no if no
	 */
	public boolean isEmptyNode();
	
	/**
	 * Returns the left child of this node or null if there is not one.
	 * @return a BinaryNode or null
	 */
	public BinaryNode<K> getLeftChild();
	
	/**
	 * Sets the left child.  Can be null for no left child.
	 * @param newLeftChild a BinaryNode or null
	 */
	public void setLeftChild(BinaryNode<K> newLeftChild);
	
	/**
	 * Returns the right child of this node or null if there is not one.
	 * @return a BinaryNode or null
	 */
	public BinaryNode<K> getRightChild();
	
	/**
	 * Sets the right child.  Can be null for no right child.
	 * @param newRightChild a BinaryNode or null
	 */
	public void setRightChild(BinaryNode<K> newRightChild);
	
	public BinaryNode<K> getParent();
	
	public void setParent(BinaryNode<K> newParent);
	
	public boolean getDuplicate();
	
	public void setDuplicate(boolean dup);
}
